program Patties;
var
  a0, b0, c0 : longint;
  a1, b1, c1 : longint;
  a2, b2, c2 : longint;
  min : longint;

begin
  read(a0, b0, c0);
  read(a1, b1, c1);
  a2 := a0 div a1;
  b2 := b0 div b1;
  c2 := c0 div c1;
  min := 100000;
  if min > a2 then min := a2;
  if min > b2 then min := b2;
  if min > c2 then min := c2;
  writeln(min);
end.